/**
 **************************************
 **   @author: 野狼上校               **
 **   @since: 2024-07-20 13:36       **
 **   @version: 1.0                  **
 **************************************
 * <P>
 *  预警记录相关Api
 */

import instance, {RespResult} from "@/api/index.ts"

/* 查询预警记录排名 */
export const getAlarmRecordOrder = (): Promise<RespResult> => {
    return instance({
        url: `/crash/alarm/getAlarmOrder`,
        method: "GET"
    })
}

/*预警设置（开启/关闭）*/
export const setAlarmOperate = (data: any): Promise<RespResult> => {
    return instance({
        url: `/crash/alarm/alarmOperate`,
        method: "GET",
        params: data
    })
}

/* 根据Device_guid查询预警记录 */
export const getAlarmRecordsByDeviceGuid = (data: any): Promise<RespResult> => {
    return instance({
        url: `/crash/alarm/getAlarmRecordsByDeviceGuid`,
        method: "GET",
        params: data
    })
}

/* 根据Id查询预警记录 */
export const getAlarmRecordById = (data: any): Promise<RespResult> => {
    return instance({
        url: `/crash/alarm/getAlarmRecordById`,
        method: "GET",
        params: data
    })
}

/**
 * 清除预警
 */
export const clearAlarmAndUpdateAlarmRecordStatus = (data:any): Promise<RespResult> => {
    return instance({
        url: `/crash/alarm/alarmOperate`,
        method: "GET",
        params: data
    })
}
/**
 * 预警记录处理
 */
export const handlerAlarmRecord = (data: any): Promise<RespResult> => {
    return instance({
        url: `/crash/alarm/handlerAlarmRecord`,
        method: "POST",
        data: data
    })
}